package com.wnxy.sk.product.mapper;

import com.wnxy.sk.product.entity.PromotionSeckill;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wnxy.sk.product.vo.PromotionProductVo;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 秒杀活动表 Mapper 接口
 * </p>
 *
 * @author Jet
 * @since 2022-10-11
 */
public interface PromotionSeckillMapper extends BaseMapper<PromotionSeckill> {

    /**
     * 秒杀活动列表
     */
    List<PromotionProductVo> findPromotionSeckill(int status);

    @Update("update pms_promotion_seckill set ps_count = ps_count-1 where id = #{promotionId}")
    int updateStore(Integer promotionId);
}
